home *** CD-ROM | disk | FTP | other *** search
- @echo off
- goto Start
- ┌───────────────╖
- │ ISLHA.BAT ║
- ╘═══════════════╝
-
- Sun 05-01-1994 22:07:52
-
- Uses LHA.EXE's Exit Codes to test to see if a Self Extracting file
- is a LHA file. Kinda cute and interesting.... Led me to make
- LHA_ZIP.BAT which processes all files. This one just processes one
- file as:
-
- COMMAND: ISLHA MyFile
- (do NOT use the *.EXE extension)
-
- ─────────────────────exit code info from lha213.doc─────────────────
-
- G. Exit Codes.
- ==============
-
- LHA will return following result codes after batch or other
- processes' execution.
-
- 0. Normal.
-
- 1. CRC error occured, probably with 'e','x','t' commands.
- Or LHA failed to create files because of disk space, or
- because of files in existence.
-
- 2. Fatal error. Process terminated without transactions.
-
- 3. Failed to write temporary files in the archive. You may
- find a temporary file LHTEMP)2(.LZH on your working direct
- ory. You may rename this file with extension LZH, and use
- it as an archive.
-
-
- ───────────────END exit code info from lha213.doc─────────────────
- :Start
-
- lha t %1.exe
- rem lha t am.exe (test mode)
- if errorlevel 3 if not errorlevel 4 goto NoTempFile
- if errorlevel 2 if not errorlevel 3 goto NotLHA
- if errorlevel 1 if not errorlevel 2 goto NotLHA
- if errorlevel 0 if not errorlevel 1 goto Report
- goto End
- :Report
- echo Archived file %1.EXE is a LHA.EXE Archived file >> islha.txt
- echo Archived file %1.EXE is a LHA.EXE Archived file
- echo
- pause
- goto End
- :NotLHA
- echo Archived file %1.EXE is =NOT= a LHA.EXE archived file >> islha.txt
- echo Archived file %1.EXE is =NOT= a LHA.EXE archived file
- echo
- pause
- goto End
- :NoTempFile
- echo No temporary file was written, check directory
- echo
- pause
- goto End
- :End
-